package com.dzx.service;

import cn.hutool.core.util.RandomUtil;
import com.alibaba.fastjson.JSONObject;
import com.dzx.feign.ProviderClientFeign;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class TestService {
    @Autowired
    ProviderClientFeign providerClientFeign;

    public String sayHi(String name){
        return  providerClientFeign.sayHiFromClientConsul(name);
    }
    public String sayHi2(String name){
        JSONObject obj=new JSONObject();
        obj.put("name",name);
        obj.put("age",RandomUtil.randomInt(10,99));
        return  providerClientFeign.sayHiFromClientConsul2(obj);
    }

}
